import React   from 'react';
// 循环渲染
class App extends React.Component {
    state = {
      list: [
        {
          id: 1,
          text: "1111",
        },
        {
          id: 2,
          text: "2222",
        },
        {
          id: 3,
          text: "3333",
        },
      ],
    };
  
    render() {
      return (
        <div>
          <ul>
            {/**循环就是用的js中的.map 遍历 */}
            {this.state.list.map((item,index)=>{
              // 判断就是在js 代码判断
                if(item.id !== 1){
                  return ( <li key={index}>
                    {item.text}
                    </li>)
                }
                return "";
              }
            )}
          {/* {this.state.list.map((item,index)=>{
               return <li key={item.id}>
                  {item.text}
                </li>
            })}  */}
           
          </ul>
        </div>
      );
    }
  }

export default App;